package com.xydtech.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 电子地图配置虚拟路径映射本地路径
 *
 * @author yuzhiguo
 * @date 2024/6/21 下午2:07
 */
@Configuration
public class EcardApiResourceConfig implements WebMvcConfigurer {

	@Value("${ysp.tileIp}")
	private String tileIp;

	/*
	*addResourceHandler:访问映射路径
	*addResourceLocations:资源绝对路径
	*/
	@Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/tiles/**").addResourceLocations("file:" + tileIp);
    }
}
